from openai import OpenAI
# Set OpenAI's API key and API base to use vLLM's API server.

# 使用 vLLM 的 API 服务器需要设置 OpenAI 的 API 密钥和 API 库。

"""
这里是手动设置模型的位置！！！！
同时用的是多轮对话！！！！
"""



openai_api_key = "EMPTY"
openai_api_base = "http://localhost:8000/v1"

client = OpenAI(
    api_key=openai_api_key,
    base_url=openai_api_base,
)

chat_response = client.chat.completions.create(
    model="/gemini/pretrain/Qwen2.5-0.5B-Instruct",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "给我讲一个笑话"},
    ]
)
print("Chat response:", chat_response)